package com.tanhua.commons;

import com.tanhua.commons.properties.*;
import com.tanhua.commons.template.*;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
@EnableConfigurationProperties({
        AliyunSmsProperties.class,
        AliyunOssProperties.class,
        BaiduAipFaceProperties.class,
        HuanXinProperties.class,
        BaiduCensorProperties.class
})
public class TanhuaCommonsAutoConfiguration {
    @Bean
    public AliyunSmsTemplate smsTemplate(){
        return new AliyunSmsTemplate();
    }
    @Bean
    public AliyunOssTemplate ossTemplate() {
        return new AliyunOssTemplate();
    }
    @Bean
    public BaiduAipFaceTemplate baiduAipFaceTemplate(BaiduAipFaceProperties properties){
        return new BaiduAipFaceTemplate(properties);
    }
    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties properties){
        return new HuanXinTemplate(properties);
    }

    @Bean
    public BaiduCensorTemplate censorTemplate(BaiduCensorProperties properties){
        return new BaiduCensorTemplate(properties);
    }

}
